package com.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.entity.IssueTypeEntity;

@Repository
public class IssueTypeDaoImpl extends GenericDaoImpl<IssueTypeEntity> implements IssueTypeDao {

	public IssueTypeEntity getIssueTypeById(int id) {
		return getById(IssueTypeEntity.class, id);
	}

	public List<IssueTypeEntity> getAllIssueType() {
		return getAll(IssueTypeEntity.class);
	}

	public IssueTypeEntity getIssueTypeByUniqueId(String id) {
		String hql = "From IssueTypeEntity where id =:id";
		Query query = sessionFactory.getCurrentSession().createQuery(hql);
		query.setParameter("id",id);
		return (IssueTypeEntity) query.uniqueResult();
	}

}
